<%@include file="/WEB-INF/includes/taglibs.jsp" %>
<fmt:setLocale value="en_AU"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Cashflow Manager | <tiles:getAsString name="title" /></title>
		<spring:url value="/static/images/favicon.ico" var="icoFavIcon" />
		<spring:url value="/static/styles/standard.css" var="cssStandard" />
		<spring:url value="/static/scripts/common.js" var="jsCommon" />
		<spring:url value="/static/scripts/jquery-1.4.2.min.js" var="jsJQuery" />
		<link rel="SHORTCUT ICON" href="${icoFavIcon}" />		
		<link rel="stylesheet" type="text/css" href="${cssStandard}" />		
		<script src="${jsJQuery}" type="text/javascript"></script>
		<script src="${jsCommon}" type="text/javascript"></script>				
	</head>
   	<body>
   		<table class="layout">
   			<tr>
   				<td>
   					<spring:url value="/" var="urlHome" />
   					<spring:url value="/static/images/logo.gif" var="imgLogo" />
   					<a href="${urlHome}"><img src="${imgLogo}"/></a>
   				</td>
   				<td align="right">
   					Signed in as Pete | 
	   				<spring:url var="logout" value="/static/j_spring_security_logout" />
	   				<a href="${logout}">Sign out</a> 
   				</td>
   			</tr>
   			<tr class="navigation">
   				<td>   					
   					<c:if test="${not empty accounts}">
						<spring:url var="viewAccount" value="/account"/>
		   				<form id="viewAccount" method="get" action="${viewAccount}">
		   					<label for="selectAccount">Account:</label>
		   					<select id="selectAccount">
		   						<c:forEach items="${accounts}" var="selectAccount">
		   							<c:choose>
			   							<c:when test="${not empty account and account.id == selectAccount.id}">
											<option selected="true" value="${selectAccount.id}">${selectAccount}</option>
			   							</c:when>
			   							<c:otherwise>
			   								<option value="${selectAccount.id}">${selectAccount}</option>
			   							</c:otherwise>
		   							</c:choose>		   							
		   						</c:forEach>        
		                    </select>
		                    <input id="btnChangeAccount" type="button" value="View" />		                    
		   				</form>   				
	   				</c:if>
   				</td>
   				<td align="right">
   					<spring:url var="addAccount" value="/accounts/create"/>
	   				<form id="addAccount" method="get" action="${addAccount}">
	   					<div class="submit">
	   						<input type="submit" value="Add Account" />
	   					</div>
	   				</form>
   				</td>
   			</tr>
   			<tr>
   				<td colspan="2" align="center">
					<tiles:insertAttribute name="content" />
   				</td>
   			</tr>
   		</table>  
	</body>
</html>
